#ifndef LOGIC_H
#define LOGIC_H
#ifdef __cplusplus

extern "C"{

#endif
#include "stm32l1xx_hal.h"
//#define SHORT_DEBUG

extern RTC_HandleTypeDef hrtc;
extern UART_HandleTypeDef huart1;
extern ADC_HandleTypeDef hadc;

extern uint8_t u1Len;
extern uint8_t u1Buff[256];
extern RTC_DateTypeDef gData;
extern RTC_TimeTypeDef gTime;
extern uint8_t gSrcAddr;
extern uint16_t gBtValue;
extern float   gPressVal;
extern float   gTemp;
extern uint8_t    wakeFromPin;
extern uint8_t    gSendFlag;
uint16_t Power_ADC_Read(uint32_t timeout);
void Set_Rtc_Time(void);
void Get_Rtc_Time(void);
void Set_AlarmA_Time(uint8_t perHour,uint8_t perMin,uint8_t perSec);
void Set_AlarmB_Time(uint8_t perHour,uint8_t perMin,uint8_t perSec);
void Cycle_Scure_Report(void);
void Scan_MulBtn(void);
void Record_Press(void);
void Enter_Stop_Mode(void);
void Exit_Stop_Mode(void);
void RTCA_Callback(void);
#ifdef __cplusplus

};

#endif
#endif
